<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://java.sun.com/jsf/facelets"
   xmlns:f="http://java.sun.com/jsf/core"
   xmlns:h="http://java.sun.com/jsf/html">
   

      <h:form id="reg">
         
        
		<h:panelGrid columns="3" columnClasses="titleCell">
		   <h:outputLabel for="name" value="Name:"/>
		   <h:inputText id="name" value="#{newEmployee.name}" />
		   <h:message for="name" errorClass="invalid"/>
		
		   <h:outputLabel for="email" value="Email:"/>
		   <h:inputText id="email" value="#{newEmployee.email}"/>
		   <h:message for="email" errorClass="invalid"/>
		
		   <h:outputLabel for="phoneNumber" value="Phone #:"/>
		   <h:inputText id="phoneNumber" value="#{newEmployee.phoneNumber}"/>
		   <h:message for="phoneNumber" errorClass="invalid"/>
		
		</h:panelGrid>

		<h2>Employee pay slip</h2>  
	
		<h:dataTable var="recibo" value="#{employeeController.recibos}">
		   	<h:column>
				<f:facet name="header">Importe</f:facet>
				<h:inputText id="Importe" value="#{recibo.importe}"/>
				<h:message for="Importe" errorClass="invalid"/>
		    </h:column>

		   	<h:column>
				<f:facet name="header">Fecha</f:facet>
				<h:inputText id="date" value="#{recibo.fechaCobro}" label="dd-MM-yyyy">
					<f:convertDateTime pattern="dd-MM-yyyy" />
				</h:inputText>
				<h:message for="date" errorClass="invalid"/>
		    </h:column>
		</h:dataTable>
        
		<p>
		   <h:panelGrid columns="2">
		      <h:commandButton id="register" action="#{employeeController.register}" value="Register" styleClass="register"/>
		      <h:messages styleClass="messages" errorClass="invalid" infoClass="valid" warnClass="warning"
		                  globalOnly="true"/>
		   </h:panelGrid>
		</p>

      </h:form>

</ui:composition>
